home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PsL Monthly 1993 December
/
PSL Monthly Shareware CD-ROM (December 1993).iso
/
prgmming
/
dos
/
pascal
/
tpref.exe
/
TPR7.TXT
< prev
next >
Wrap
Text File
|
1992-10-19
|
47KB
|
1,298 lines
Chapter 7
of the
Turbo Pascal Reference
The Turbo Vision Reference
(continued)
This chapter is part of the Turbo Pascal Reference electronic freeware book (C)
Copyright 1992 by Ed Mitchell. This freeware book contains supplementary
material to Borland Pascal Developer's Guide, published by Que Corporation,
1992. However, Que Corporation has no affiliation with nor responsibility for
the content of this free book. Please see Chapter 1 of the Turbo Pascal
Reference for important information about your right to distribute and use this
material freely. If you find this material of use, I would appreciate your
purchase of one my books, such as the Borland Pascal Developer's Guide or
Secrets of the Borland C++ Masters, Sams Books, 1992. Thank you.
For additional information on using Turbo Vision, including a detailed
tutorial, please see Chapters 11 through 16 of the Borland Pascal Developer's
Guide.
HistoryAdd procedure
------------------------------------------------------------
Declaration:
procedure HistoryAdd
( Id: Byte; var Str: String);
Unit: HistList
Purpose:
This is an internal routine used by the THistory and related objects to
add a string Str to the history list identified by the Id number.
HistoryBlock variable
------------------------------------------------------------
Declaration:
HistoryBlock: Pointer = nil;
Unit: HistList
Purpose:
The THistory object allocates a block of memory from the heap in order to
store the history list. HistoryBlock is set to point to this memory
block.
HistoryCount function
------------------------------------------------------------
Declaration:
function HistoryCount(Id: Byte): Word;
Unit: HistList
Purpose:
The THistory history list system, and the associated history list memory
manager (See HistoryAdd, HistoryBlock, HistorySize, HistoryStr,
HistoryUsed) can manage multiple memory history lists. The HistoryCount
function calculates and returns the number of items stored in the history
list selected by the Id value.
HistorySize variable
------------------------------------------------------------
Declaration:
HistorySize: Word = 1024;
Unit:
HistList
Purpose:
At program initialization, TApplication.Init calls the InitHistory
procedure to allocate history list memory space. The default allocation
is determined by the value stored in HistorySize. To change this value,
set HistorySize to a new size, specified in bytes, before calling
TApplication.Init.
HistoryStr function
------------------------------------------------------------
Declaration:
function HistoryStr(Id: Byte; Index: Integer): String;
Unit: HistList
Purpose:
Looks into the history list specified by Id, and returns the contents of
the Index'th string in the list.
HistoryUsed variable
------------------------------------------------------------
Declaration:
HistoryUsed: Word = 0;
Unit: HistList
Purpose:
This is an internal value used by the history list routines.
InitHistory procedure
------------------------------------------------------------
Declaration:
procedure InitHistory;
Unit: HistList
Purpose:
TApplication.Init calls this routine to initialize the history list
management system. Also see HistorySize and THistory.
InputBox function
------------------------------------------------------------
Declaration:
function InputBox (Title : String;
ALabel : String;
var S : String;
Limit : Byte ) : Word;
Unit: MsgBox, source code in \TP\TVDEMOS\MSGBOX.PAS
Purpose:
InputBox is not described in the Borland documentation but is contained in
the file MSGBOX.PAS (and MSGBOX.TPU) contained in the \TP\TVDEMOS directory (TP
6.0).
InputBox displays a simple dialog with a single label and input field,
plus Okay and Cancel buttons. The Title parameter becomes the dialog box
title, and the input field is given ALabel as a prompt line. The input field
is set to Limit bytes in length. InputBox returns eithe cmOkay or cmCancel.
See Listing DMSGBOX3.PAS for an example of using the message box.
1 { DMSGBOX3.PAS
2 Demonstrates use of InputBox
3 }
4 procedure TShell.DemoInputBox;
5 var
6 Control : Word;
7 begin
8 Control := InputBox('The Title', 'Enter some text:',
FileName, 30);
9 end; { TShell.DemoInputBox }
See: MessageBox, InputBoxRect, MessageBoxRect for related functions.
InputBoxRect function
------------------------------------------------------------
Declaration:
function InputBox (var Bounds : TRect;
Title : String;
ALabel : String;
var S : String;
Limit : Byte ) : Word;
Unit: MsgBox, source code in \TP\TVDEMOS\MSGBOX.PAS
Purpose:
InputBoxRect is not described in the Borland documentation but is
contained in the file MSGBOX.PAS (and MSGBOX.TPU) contained in the \TP\TVDEMOS
directory (TP 6.0).
InputBoxRect is identical to InputBox except that you can specify a
bounding rectangle in order to position and size the input box to specific
coordinates. See also MessageBoxRect.
See: InputBox, MessageBox, MessageBoxRect
InitEvents procedure
------------------------------------------------------------
Declaration:
procedure InitEvents;
Unit: Drivers;
Purpose:
This internal procedure initializes Turbo Vision's event manager, and
initializes and displays the mouse, if installed. InitEvents is
automatically called by TApplication.Init, and is terminated by calling
its corresponding DoneEvent procedure.
InitMemory procedure
------------------------------------------------------------
Declaration:
procedure InitMemory;
Unit: Memory
Purpose:
This internal procedure initialize's Turbo Vision's memory management
system and is automatically called by TApplication.Init. InitMemory is
terminated by calling its corresponding DoneMemory.
InitSysError procedure
------------------------------------------------------------
Declaration:
procedure InitSysError;
Unit: Drivers
Purpose:
This internal procedure, called by TApplication.Init, initializes system
error trapping by redirecting the interrupt vectors 09H, 1BH, 21H, 23H,
and 24H and clearing DOS's Ctrl-Break state. System error trapping is
terminated by calling the corresponding DoneSysError routine.
InitVideo procedure
------------------------------------------------------------
Declaration:
procedure InitVideo;
Unit: Drivers
Purpose:
This internal procedure, called by TApplication.Init, initialize's Turbo
Vision's video display manager and switches the display to the mode
specified in the ScreenMode variable. InitVideo initializes the variables
ScreenWidth, ScreenHeight, HiResScreen, CheckSnow, ScreenBuffer and
CursorLines.
kbXXXX constants
------------------------------------------------------------
Keyboard constants
The kbXXXX constants are divided into two groups: a small group for
detecting keyboard shift states, and a large group as equates for the
non-standard keystrokes such as function and Alt keys.
Keyboard Shift State constants
Constant Value Usage
kbRightShift $0001 Bit set if the right shift key down
kbLeftShift $0002 Bit set if the left shift key down
kbCtrlShift $0004 Bit set if the Ctrl key is down
kbAltShift $0008 Bit set if the Alt key is down
kbScrollState $0010 B